package cn.iocoder.yudao.module.system.controller.admin.warehouse.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.List;

@Data
@Schema(description = "金料仓库-创建/更新请求")
public class GoldMaterialWarehouseSaveReqVO {
    @Schema(description = "主键，更新时必传") private Long id;

    @NotBlank
    @Size(max = 50) private String code;
    @NotBlank @Size(max = 100) private String name;
    @NotNull
    private Integer type; // 1-公司仓，2-团队仓，3-人员仓
    
    //@Schema(description = "团队ID（团队仓必填，用于指定该团队仓属于哪个团队）")
    private Long teamId;
    
    //@Schema(description = "用户ID（人员仓必填，用于指定该人员仓属于哪个用户）")
    private Long userId;
    
    @Schema(description = "团队仓ID（人员仓必填，用于指定该人员仓属于哪个团队仓）")
    private Long teamWarehouseId;
    @DecimalMin(value = "0", inclusive = true) @Digits(integer = 7, fraction = 3)
    private BigDecimal balance;
    @Size(max = 50) private String responsiblePerson;
    @NotNull private Integer status; // 0/1
    
    /**
     * 绑定的用户列表（用于权限控制）
     * 格式: [{"userId": 1, "userType": 2, "permissionLevel": 1}]
     */
    private List<BindUserVO> bindUsers;
    
    @Data
    @Schema(description = "绑定用户信息")
    public static class BindUserVO {
        @Schema(description = "用户ID")
        private Long userId;
        
        @Schema(description = "用户类型：1-公司账号，2-团队账号，3-个人账号")
        private Integer userType;
        
        @Schema(description = "权限级别：1-查看，2-管理")
        private Integer permissionLevel = 1;
    }
}